package wqh.service.impl;

import org.springframework.stereotype.Service;
import wqh.dao.DeviceDao;
import wqh.domain.Device;
import wqh.service.DeviceService;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by devts on 2016/9/25.
 */
@Service("deviceService")
public class DeviceServiceImpl implements DeviceService {

    @Resource
    private DeviceDao deviceDao;

    public List<Device> findAllRecord() {
        return this.deviceDao.findAllRecord();
    }

    public List<Device> findRecordByName(String name) {
        return this.deviceDao.findRecordByName(name);
    }

    public Device findAllByID(Integer id) {
        return this.deviceDao.findAllByID(id);
    }

    public List<Device> findAllByNameAndIP(String name, Integer ip) {
        return this.deviceDao.findAllByNameAndIP(name,ip);
    }

    public int insertRecord(Device device) {
        return this.deviceDao.insertRecord(device);
    }

    public int updateRecord(Device device) {
        return this.deviceDao.updateRecord(device);
    }

    public int deleteRecord(Integer id) {
        return this.deviceDao.deleteRecord(id);
    }

    public String findNameById(Integer id) {
        return this.deviceDao.findNameById(id);
    }

    public Device findAllByIp(Integer ip_int) {
        return this.deviceDao.findAllByIp(ip_int);
    }

    public List<Device> findByIp(Integer ip) {
        return this.deviceDao.findByIp(ip);
    }
}
